| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 1 | Date: May 15, 2006 |
| Daniel Stenberg | 911d135 | 2005-09-02 13:40:07 +0000 | [diff] [blame] | 2 | Author: Daniel Stenberg <daniel@haxx.se> |
| 3 | URL: http://curl.haxx.se/legal/distro-dilemma.html |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 4 | |
| 5 | Condition |
| 6 | |
| Daniel Stenberg | bf6588b | 2005-09-30 08:34:51 +0000 | [diff] [blame] | 7 | This document is written to describe the situation as it is right |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 8 | now. libcurl 7.15.3 is currently the latest version available. Things may of |
| 9 | course change in the future. |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 10 | |
| 11 | This document reflects my view and understanding of these things. Please tell |
| 12 | me where and how you think I'm wrong, and I'll try to correct my mistakes. |
| 13 | |
| 14 | Background |
| 15 | |
| 16 | The Free Software Foundation has deemed the Original BSD license[1] to be |
| 17 | "incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but |
| 18 | the point is the same: if you distribute a binary version of a GPL program, |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 19 | it MUST NOT be linked with any Original BSD-licensed parts or libraries. |
| 20 | Doing so will violate the GPL license. For a long time, very many GPL |
| 21 | licensed programs have avoided this license mess by adding an exception[8] to |
| 22 | their license. And many others have just closed their eyes for this problem. |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 23 | |
| 24 | libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto |
| 25 | our plates? |
| 26 | |
| 27 | libcurl is only a little library. libcurl can be built to use OpenSSL for its |
| 28 | SSL/TLS capabilities. OpenSSL is basically Original BSD licensed[5]. |
| 29 | |
| 30 | If libcurl built to use OpenSSL is used by a GPL-licensed application and you |
| 31 | decide to distribute a binary version of it (Linux distros - for example - |
| 32 | tend to), you have a clash. GPL vs Original BSD. |
| 33 | |
| 34 | This dilemma is not libcurl-specific nor is it specific to any particular |
| Daniel Stenberg | d49edc8 | 2005-10-27 20:51:43 +0000 | [diff] [blame] | 35 | Linux distro. (This article mentions and refers to Debian several times, but |
| 36 | only because Debian seems to be the only Linux distro to have faced this |
| 37 | issue yet since no other distro is shipping libcurl built with two SSL |
| 38 | libraries.) |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 39 | |
| 40 | Part of the Operating System |
| 41 | |
| 42 | This would not be a problem if the used lib would be considered part of the |
| Daniel Stenberg | bf6588b | 2005-09-30 08:34:51 +0000 | [diff] [blame] | 43 | underlying operating system, as then the GPL license has an exception |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 44 | clause[6] that allows applications to use such libs without having to be |
| 45 | allowed to distribute it or its sources. Possibly some distros will claim |
| 46 | that OpenSSL is part of their operating system. |
| 47 | |
| 48 | Debian does however not take this stance and has officially(?) claimed that |
| 49 | OpenSSL is not a required part of the Debian operating system |
| 50 | |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 51 | GnuTLS |
| 52 | |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 53 | With the release of libcurl 7.14.0 (May 2005), libcurl can now get built to |
| 54 | use GnuTLS instead of OpenSSL. GnuTLS is an LGPL[7] licensed library that |
| 55 | offers a matching set of features as OpenSSL does. Now, you can build and |
| 56 | distribute an TLS/SSL capable libcurl without including any Original BSD |
| 57 | licensed code. |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 58 | |
| 59 | I believe Debian is the first distro to provide libcurl/GnutTLS packages. |
| 60 | |
| 61 | GnuTLS vs OpenSSL |
| Daniel Stenberg | 0177476 | 2005-09-01 08:43:44 +0000 | [diff] [blame] | 62 | |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 63 | While these two libraries offer similar features, they are not equal. Both |
| 64 | libraries have features the other one lacks. libcurl does not (yet) offer a |
| 65 | standardized stable ABI if you decide to switch from using libcurl-openssl to |
| 66 | libcurl-gnutls or vice versa. The GnuTLS support is very recent in libcurl |
| 67 | and it has not been tested nor used very extensively, while the OpenSSL |
| 68 | equivalent code has been used and thus matured for more than seven (7) years. |
| 69 | |
| Daniel Stenberg | d49edc8 | 2005-10-27 20:51:43 +0000 | [diff] [blame] | 70 | GnuTLS |
| 71 | - LGPL licensened |
| 72 | - supports SRP |
| 73 | - lacks SSLv2 support |
| 74 | - lacks MD2 support (used by at least some CA certs) |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 75 | - lacks the crypto functions libcurl uses for NTLM |
| Daniel Stenberg | d49edc8 | 2005-10-27 20:51:43 +0000 | [diff] [blame] | 76 | |
| 77 | OpenSSL |
| 78 | - Original BSD licensened |
| 79 | - lacks SRP |
| 80 | - supports SSLv2 |
| 81 | - older and more widely used |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 82 | - provides crypto functions libcurl uses for NTLM |
| 83 | - libcurl can do non-blocking connects with it in 7.15.4 and later |
| Daniel Stenberg | d49edc8 | 2005-10-27 20:51:43 +0000 | [diff] [blame] | 84 | |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 85 | The Better License, Original BSD or LGPL? |
| 86 | |
| 87 | It isn't obvious or without debate to any objective interested party that |
| 88 | either of these licenses are the "better" or even the "preferred" one in a |
| Daniel Stenberg | e0785ad | 2005-09-01 15:03:45 +0000 | [diff] [blame] | 89 | generic situation. |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 90 | |
| 91 | Instead, I think we should accept the fact that the SSL/TLS libraries and |
| 92 | their different licenses will fit different applications and their authors |
| 93 | differently depending on the applications' licenses and their general usage |
| Daniel Stenberg | bf6588b | 2005-09-30 08:34:51 +0000 | [diff] [blame] | 94 | pattern (considering how LGPL libraries for example can be burdensome for |
| 95 | embedded systems usage). |
| 96 | |
| 97 | In Debian land, there seems to be a common opinion that LGPL is "maximally |
| 98 | compatible" with apps while Original BSD is not. Like this: |
| 99 | |
| 100 | http://lists.debian.org/debian-devel/2005/09/msg01417.html |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 101 | |
| 102 | More SSL Libraries |
| 103 | |
| 104 | In libcurl, there's no stopping us here. There are at least a few more Open |
| 105 | Source/Free SSL/TLS libraries and we would very much like to support them as |
| 106 | well, to offer application authors an even wider scope of choice. |
| 107 | |
| 108 | Application Angle of this Problem |
| 109 | |
| 110 | libcurl is built to use one SSL/TLS library. It uses a single fixed name (by |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 111 | default) on the built/created lib file, and applications are built/linked to |
| 112 | use that single lib. Replacing one libcurl instance with another one that |
| 113 | uses the other SSL/TLS library might break one or more applications (due to |
| 114 | ABI differences and/or different feature set). You want your application to |
| 115 | use the libcurl it was built for. |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 116 | |
| 117 | Project cURL Angle of this Problem |
| 118 | |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 119 | We distribute libcurl and everyone may build libcurl with either library at |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 120 | their choice. This problem is not directly a problem of ours. It merely |
| 121 | affects users - GPL application authors only - of our lib as it comes |
| 122 | included and delivered on some distros. |
| 123 | |
| Daniel Stenberg | 911d135 | 2005-09-02 13:40:07 +0000 | [diff] [blame] | 124 | libcurl has different ABI when built with different SSL/TLS libraries due to |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 125 | these reasons: |
| Daniel Stenberg | 911d135 | 2005-09-02 13:40:07 +0000 | [diff] [blame] | 126 | |
| 127 | 1. No one has worked on fixing this. The mutex/lock callbacks should be set |
| 128 | with a generic libcurl function that should use the proper underlying |
| 129 | functions. |
| 130 | |
| 131 | 2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS |
| 132 | but simply requires OpenSSL. |
| 133 | |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 134 | 3. There might be some other subtle differences just because nobody has yet |
| 135 | tried to make a fixed ABI like this. |
| 136 | |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 137 | Distro Angle of this Problem |
| 138 | |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 139 | To my knowledge there is only one distro that ships libcurl built with either |
| 140 | one of the SSL libs supported. |
| 141 | |
| 142 | Debian Linux is now (since mid September 2005) providing two different |
| 143 | libcurl packages, one for libcurl built with OpenSSL and one built with |
| 144 | GnuTLS. They use different .so names and can this both be installed in a |
| 145 | single system simultaneously. This has been said to be a transitional system |
| 146 | not desired to keep in the long run. |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 147 | |
| 148 | Fixing the Only Problem |
| 149 | |
| 150 | The only problem is thus for distributions that want to offer libcurl |
| 151 | versions built with more than one SSL/TLS library. |
| 152 | |
| 153 | Since multiple libcurl binaries using different names are ruled out, we need |
| 154 | to come up with a way to have one single libcurl that someone uses different |
| 155 | underlying libraries. The best(?) approach currently suggested involves this: |
| 156 | |
| 157 | A new intermediate library (named lib2 so far in the discussions) with the |
| 158 | single purpose of providing libcurl with SSL/TLS capabilities. It would have |
| 159 | a unified API and ABI no matter what underlying library it would use. |
| 160 | |
| 161 | There would be one lib2 binary provided for each supported SSL/TLS library. |
| 162 | For example: lib2-openssl, lib2-gnutls, lib2-yassl, lib2-matrixssl and |
| 163 | lib2-nossl. Yes, take note of the last one that provides the lib2 ABI but |
| 164 | that lacks the actual powers. |
| 165 | |
| 166 | When libcurl is built and linked, it will be linked against a lib2 with the |
| 167 | set ABI. |
| 168 | |
| 169 | When you link an app against libcurl, it would also need to provide one of |
| 170 | the (many) lib2 libs to decide what approach that fits the app. An app that |
| 171 | doesn't want SSL at all would still need to link with the lib2-nossl lib. |
| 172 | |
| 173 | GPL apps can pick the lib2-gnutls, others may pick the lib2-openssl. |
| 174 | |
| 175 | This concept works equally well both for shared and static libraries. |
| 176 | |
| Daniel Stenberg | e0785ad | 2005-09-01 15:03:45 +0000 | [diff] [blame] | 177 | A positive side effect of this approach could be a more generic "de facto" |
| 178 | standard API for SSL/TLS libraries. |
| 179 | |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 180 | When Will This Happen |
| 181 | |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 182 | This is not a problem in curl, it doesn't solve any actual technical problems |
| 183 | in our project. Don't hold your breath for this to happen very soon (if at |
| 184 | all) unless you step forward and contribute. |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 185 | |
| 186 | The suggestion that is outlined above is still only a suggestion. Feel free |
| 187 | to bring a better idea! |
| 188 | |
| 189 | Also, to keep in mind: I don't want this new concept to have too much of an |
| 190 | impact on the existing code. Preferably it should be possible to build the |
| 191 | code like today (without the use of lib2), should you decide to ignore the |
| 192 | problems outlined in this document. |
| 193 | |
| Daniel Stenberg | dadf3f0 | 2006-05-15 08:09:07 +0000 | [diff] [blame] | 194 | Work on this was suggested by Richard Atterer: |
| Daniel Stenberg | 8c12136 | 2005-09-05 06:03:06 +0000 | [diff] [blame] | 195 | |
| 196 | http://curl.haxx.se/mail/lib-2005-09/0066.html |
| 197 | |
| Daniel Stenberg | 76d7dfa | 2005-09-01 08:35:59 +0000 | [diff] [blame] | 198 | Footnotes |
| 199 | |
| 200 | [1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6 |
| 201 | [2] = http://www.fsf.org/licensing/essays/bsd.html |
| 202 | [3] = http://www.fsf.org/licensing/licenses/gpl.html |
| 203 | [4] = http://curl.haxx.se/docs/copyright.html |
| 204 | [5] = http://www.openssl.org/source/license.html |
| 205 | [6] = http://www.fsf.org/licensing/licenses/gpl.html end of section 3 |
| 206 | [7] = http://www.fsf.org/licensing/licenses/lgpl.html |
| 207 | [8] = http://en.wikipedia.org/wiki/OpenSSL_exception |
| Daniel Stenberg | e0785ad | 2005-09-01 15:03:45 +0000 | [diff] [blame] | 208 | |
| 209 | Feedback/Updates provided by |
| 210 | |
| 211 | Eric Cooper |